package com.binge.test_kafka;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.junit.Test;

import java.util.Properties;

/**
 * ClassName:KafkaConsumerTest
 * Package:com.binge.test_kafka
 * Description:
 *
 * @Author @Bin
 * @Date 2024/8/20-10:18
 * @Version: v1.0
 */
@Slf4j
public class KafkaConsumerTest {

    @Test
    public void testConsumer() {
        Properties properties = new Properties();
        properties.put("bootstrap.servers", "");
        properties.put("group.id", "");
        properties.put("enable.auto.commit", "true");
        properties.put("auto.commit.interval.ms", "1000");
        properties.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        properties.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
        KafkaConsumer<String, String> consumer = new KafkaConsumer<>(properties);
        //consumer.subscribe();
        consumer.poll(100);

    }
}
